import mockjs, { Random } from "mockjs";

export default [
  {
    url: "/front/user/login",
    method: "post",
    response: {
      state: 1,
      message: "success",
      success: true,
      content:
        '{"access_token":"11qwertyuiopasdfghjklzxcvbnm","expires_in":5000,"jti":"asdfghjklsfeo","organization":10000000000,"refresh_token":"abcdefghijklmnopqrst","scope":"read","token_type":"bearer","user_id":100030019}',
    },
  },
  {
    url: "/front/user/refresh_token",
    method: "post",
    response: {
      state: 1,
      message: "success",
      success: true,
      content:
        '{"access_token":"22qwertyuiopasdfghjklzxcvbnm","expires_in":5000,"jti":"asdfghjklsfeo","organization":10000000000,"refresh_token":"abcdefghijklmnopqrst","scope":"read","token_type":"bearer","user_id":100030019}',
    },
  },
  {
    url: "/front/user/getInfo",
    method: "get",
    response: {
      state: 1,
      message: "success",
      success: true,
      content: {
        isUpatedPassword: true,
        weixinNickName: "BoreyLee",
        userName: "boreyLee",
        portrait: "https://img.yzcdn.cn/vant/tree.jpg",
      },
    },
  },
  {
    url: "/boss/menu/saveOrUpdate",
    method: "post",
    response: {
      code: "000000",
      data: true,
    },
  },
  {
    url: "/boss/menu/getEditMenuInfo",
    method: "get",
    response: {
      code: "000000",
      data: {
        menuInfo: null,
        ...mockjs.mock({
          "parentMenuList|1-5": [
            {
              createdBy: Random.datetime(),
              updatedBy: Random.datetime(),
              createdTime: Random.datetime(),
              updatedTime: Random.datetime(),
              parentId: Random.integer(1, 10),
              description: Random.paragraph(),
              href: Random.url(),
              icon: Random.image(),
              id: Random.integer(1, 100),
              level: Random.integer(0, 5),
              name: Random.name(),
              orderNum: Random.integer(0, 100),
              shown: Random.boolean(),
              selected: Random.boolean(),
              subMenuList: null,
            },
          ],
        }),
      },
    },
  },
  {
    url: "/boss/menu/getAll",
    method: "get",
    response: {
      code: "000000",
      ...mockjs.mock({
        "data|5-10": [
          {
            createdBy: Random.datetime(),
            updatedBy: Random.datetime(),
            createdTime: Random.datetime(),
            updatedTime: Random.datetime(),
            parentId: Random.integer(1, 10),
            description: Random.paragraph(),
            href: Random.url(),
            icon: Random.image(),
            id: Random.integer(1, 100),
            level: Random.integer(0, 5),
            name: Random.name(),
            orderNum: Random.integer(0, 100),
            shown: Random.boolean(),
            selected: Random.boolean(),
            subMenuList: null,
          },
        ],
      }),
    },
  },
  {
    url: "/boss/menu",
    method: "delete",
    response: {
      code: "000000",
      data: true,
    },
  },
  {
    url: "/boss/resource/getResourcePages",
    method: "post",
    response: {
      code: "000000",
      data: {
        current: 1,
        hitCount: false,
        optimizeCountSql: true,
        orders: [],
        pages: 6,
        size: 5,
        total: 51,
        ...mockjs.mock({
          "records|5-10": [
            {
              createdBy: Random.datetime(),
              updatedBy: Random.datetime(),
              createdTime: Random.datetime(),
              updatedTime: Random.datetime(),
              parentId: Random.integer(1, 10),
              description: Random.paragraph(),
              href: Random.url(),
              url: Random.url(),
              icon: Random.image(),
              id: Random.integer(1, 100),
              level: Random.integer(0, 5),
              name: Random.name(),
              orderNum: Random.integer(0, 100),
              shown: Random.boolean(),
              selected: Random.boolean(),
              subMenuList: null,
            },
          ],
        }),
      },
    },
  },
];
